<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>代码工坊 </title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="${contextPath}/plugins/bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="${contextPath}/plugins/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="${contextPath}/plugins/Ionicons/css/ionicons.min.css">
  <link rel="stylesheet" href="${contextPath}/plugins/bs-tabs/bs-tabs.css">
  <link rel="stylesheet" href="${contextPath}/plugins/toastr/2.1.3/toastr.min.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="${contextPath}/plugins/bootstrap-table/bootstrap-table.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="${contextPath}/framework/css/AdminLTE2.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="${contextPath}/framework/css/skins/_all-skins.min.css">
  <link rel="stylesheet" href="${contextPath}/framework/css/framework.css">

  

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="${contextPath}/plugins/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="${contextPath}/plugins/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="${contextPath}/plugins/font-Source-Sans-Pro/css/font-Source-Sans-Pro.css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <header class="main-header">
    <!-- Logo -->
    <a href="#" class="logo" data-toggle="push-menu">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><img src="${contextPath}/framework/img/logo45*45.png" ></span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><img src="${contextPath}/framework/img/logo45*45.png" ><b>&nbsp;&nbsp;代码工坊</b></span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- <div class="pull-left "><h4>某某软件项目名称</h4></div> -->
      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav pull-right">
          <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <img src="${contextPath}/framework/img/avatar5.png" class="user-image" alt="User Image">
              <span class="hidden-xs">下一道彩虹</span>
            </a>
            <ul class="dropdown-menu">
              <!-- User image -->
              <li class="user-header">
                <img src="${contextPath}/framework/img/avatar5.png" class="img-circle" alt="User Image">

                <p>
                  The Next Rainbow - Web Developer
                  <small>Member since 2005.07</small>
                </p>
              </li>
              <!-- Menu Footer-->
              <li class="user-footer">
                <div class="pull-left">
                  <a href="#" class="btn btn-default btn-flat">修改密码</a>
                </div>
                <div class="pull-right">
                  <a href="#" class="btn btn-default btn-flat">退出登陆</a>
                </div>
              </li>
            </ul>
          </li>

          <!-- Control Sidebar Toggle Button -->
          <!-- <li>
            <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
          </li> -->
        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      
      
      <!-- /.search form -->
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu" data-widget="tree">
        <li class="header">导航菜单</li>
        <li class="active" data-url="/user/desktop" data-title="桌面首页">
          <a href="#"><i class="fa fa-dashboard"></i><span>桌面仪表盘</span></a>
        </li>
        <li class="treeview">
          <a href="#">
            <i class="fa fa-files-o"></i> <span>字典管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li data-url="/metaDBInfo/g2manage" data-title="数据库配置" data-subtitle="链接管理">
              <a href="#"><i class="fa fa-database"></i><span>数据库配置</span></a>
            </li>
            <li><a href="#"><i class="fa fa-cogs"></i><span>配置管理</span></a></li>
            <li data-url="/metaGenObj/g2manage" data-title="元对象管理" data-subtitle="公共">
              <a href="#"><i class="fa fa-object-group"></i><span>元对象管理</span></a>
            </li>
            <li><a href="#"><i class="fa fa-share-alt"></i><span>元属性管理</span></a></li>
            <li class="treeview">
              <a href="#">
                <i class="fa fa-cubes"></i> <span>模板管理</span>
                <span class="pull-right-container">
                  <i class="fa fa-angle-left pull-right"></i>
                </span>
              </a>
              <ul class="treeview-menu">
                <li><a href="#"><i class="fa fa-cube"></i><span>界面模板管理</span></a></li>
                <li><a href="#"><i class="fa fa-file-word-o"></i><span>文档模板管理</span></a></li>
              </ul>
            </li>
          </ul>
        </li>

        <li class="treeview">
          <a href="#">
            <i class="fa fa-clone"></i> <span>生成管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li ><a href="#"><i class="fa fa-connectdevelop"></i><span>项目生成管理</span></a></li>
            <li ><a href="#"><i class="fa fa-codepen"></i><span>模块生成管理</span></a></li>
            <li ><a href="#"><i class="fa fa-table"></i><span>表生成管理</span></a></li>
            <li data-url="/gen/g2ojbguide"  data-title="生成器" data-subtitle="基于元对象">
              <a href="#"><i class="fa fa-puzzle-piece"></i><span>对象生成管理</span></a>
            </li>
          </ul>
        </li>
        <li ><a href="#"><i class="fa fa-book"></i> <span>API文档</span></a></li>
        <li ><a href="#"><i class="fa fa-circle-o"></i> <span>其它</span></a></li>
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header content-tab-header">
      <h1 class="tabTitle">仪表盘<small>Control panel</small>
      </h1>
      <ol class="breadcrumb">
        
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">


    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="pull-right hidden-xs">
      <b>Version</b> 2.4.0
    </div>
    <strong>Copyright &copy; 2018-2020 <a href="#">Rainbow</a>.</strong> All rights
    reserved.
  </footer>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Create the tabs -->
    <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
    </ul>
    <!-- Tab panes -->
    <div class="tab-content">
      <!-- Home tab content -->
      <!-- /.tab-pane -->
    </div>
  </aside>
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
<script type="text/javascript">
  var frameworkOptions = {
    enableControlSidebar:false,
    path:"${contextPath}",
    enableTab:false
    
  };
</script>
<script data-main="${contextPath}/plugins/requirejs/main" src="${contextPath}/plugins/requirejs/require.js"></script>
<script>
    
    require(["main"],function(){
      requirejs(["jquery","framework","bstabs","tipCenter","bootstrapTable"],
        function($) {
          $('.sidebar-menu').tree();
          frameworkOptions.showValidateMessages = function(validateMessages ){
            $('body').tipCenter('warning',validateMessages);
          };
          frameworkOptions.showInfoMessages = function(message ){
            $('body').tipCenter('info',message);
          };
          frameworkOptions.showSuccessMessages = function(message ){
            $('body').tipCenter('success',message);
          };
          frameworkOptions.showErrorMessages = function(message ){
            $('body').tipCenter('error',message);
          };
          frameworkOptions.clearMessages = function( ){
            $('body').tipCenter('clear');
          };
          
          
          var that = this;
          that.breadcrumbHTML = function(el){
            var html = "";
            $(el).children().eq(0).parents("li").each(function(index,element){
              var nodeUrl = $(element).data("url");
              var iNodeHTML = $(element).children().children().eq(0).prop("outerHTML");
          
              var spanNode= $(element).children().children().eq(1).prop("outerHTML");
              html = '<li data-url="'+(nodeUrl||'')+'"><a href="#">'+iNodeHTML+spanNode+'</a></li>' + html;
            });

            return html;
          }
          if(frameworkOptions && frameworkOptions.enableTab){
            $(".content-wrapper").bstabs();
            $(".content-wrapper").bstabs("newTab", (frameworkOptions.path || "")+"/desktop", "桌面仪表盘", false);
            
          }else{
            $('.content').empty();
            $('.content').load((frameworkOptions.path || "") +"/desktop");
            
            var small = $("<small>");
            small.append('控制面版');
            $('.tabTitle').empty().append('仪表盘').append(small);
            $('.breadcrumb').empty().append('<li><a href="#"><i class="fa fa-dashboard"></i> 桌面</a></li><li class="active">仪表盘</li>');
            
          }
          $(".sidebar-menu").on("leafClick.tree",function(e,el){
            var nodeUrl = $(el).data("url");
            var nodeTitle = $(el).data("title");
            var subTitle = $(el).data("subtitle");
            if(frameworkOptions && frameworkOptions.enableTab){
              $(".content-wrapper").bstabs("newTab", (frameworkOptions.path || "")+nodeUrl, nodeTitle, true);
            }else{
              $('.content').empty();
              
              var small = $("<small>");
              small.append(subTitle || "");
              $('.tabTitle').empty().append(nodeTitle || "").append(small);
              var breadcrumbHTML = this.breadcrumbHTML(el);
              $('.breadcrumb').empty().append(breadcrumbHTML);
              if(nodeUrl){
                $('.content').load((frameworkOptions.path || "") +nodeUrl);
              }
            }
          }.bind(that));
          //页面table多选框部分
          
          $(".content-wrapper").on('click','.mytable tbody .mylabel',function(){
           //当前label
            var $currentLabel=$(this);
            // var $currentTd = $(this).parents('td').eq(0);
            var $currentRow = $(this).parents('tr').eq(0);
            var $currentTable = $(this).parents('table').eq(0);
            var $headLabel = $currentTable.find('thead .mylabel');
            if($currentLabel.data('checked')){
              $currentLabel.data('checked',false);
              $currentTable.bootstrapTable('uncheck',$currentRow.data('index'));
              $currentLabel.removeClass('laeblechecked');
              $currentRow.removeClass('current');
            }else{
              $currentLabel.data('checked',true);
              $currentTable.bootstrapTable('check',$currentRow.data('index'));
              $currentLabel.addClass('laeblechecked');
              $currentRow.addClass('current');
            }
            var allChecked=true;
            $currentTable.find('tbody .mylabel').each(function(index,tempLabel){
              if(!$(tempLabel).data('checked')){
                    allChecked = false;
                    return false;
              }
            });
            if( allChecked ){
              $headLabel.data('checked',true);
              $currentTable.bootstrapTable('checkAll');
              $headLabel.addClass('laeblechecked');
            }else{
              $headLabel.data('checked',false);
              $currentTable.bootstrapTable('uncheckAll');
              $headLabel.removeClass('laeblechecked'); 
            }
          });
          //table表头的全选点击事件
          $(".content-wrapper").on('click','.mytable thead .mylabel',function(event){
            var $currentLabel=$(this);
            var $currentTable = $(this).parents('table').eq(0);
            if($currentLabel.data('checked')){
              $currentLabel.data('checked',false);
              $currentTable.bootstrapTable('uncheckAll');
              $currentLabel.removeClass('laeblechecked');
              $currentTable.find('tbody tr').each(function(index,tr){
                $(tr).find('.mylabel').removeClass('laeblechecked');
                $(tr).removeClass('current');
              });
            }else{
              $currentLabel.data('checked',true);
              $currentTable.bootstrapTable('checkAll');
              $currentLabel.addClass('laeblechecked');
              $currentTable.find('tbody tr').each(function(index,tr){
                $(tr).find('.mylabel').addClass('laeblechecked');
                $(tr).addClass('current');
              });
            }
          });
      
        }
      );
  });
    </script>





</body>
</html>
